package com.hzhjhh.view.manageView.menus.purchase.payment;

import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;

import com.hzhjhh.init.dialog.Mytable;
import com.hzhjhh.view.manageView.menus.purchase.PaymentOrderDialog;
import com.hzhjhh.view.manageView.menus.purchase.constant.ShowConstants;

/**
 * 菜单栏初始化-采购-付款单弹出框-确定按钮
 * 
 * @author 12083
 *
 */
public class EnsureBt {

	/**
	 * 按钮
	 */
	public static JButton btInit(PaymentOrderDialog paymentOrderDialog) {
		JButton ensure = new JButton();
		ensure.setBounds(259, 376, 80, 35);
		ensure.setText("确定");
		ensure.addActionListener(event -> {
			Vector colnames4 = paymentOrderDialog.getRowDatas();
			JTextField txfOrderId = paymentOrderDialog.getTxfOrderId();
			JTextField txfCurrency = paymentOrderDialog.getTxfCurrency();
			JTextField txfPayAmt = paymentOrderDialog.getTxfPayAmt();
			JTextField txfPayType = paymentOrderDialog.getTxfPayType();
			JTextField txfBillNum = paymentOrderDialog.getTxfBillNum();
			JTextField txfSupplier = paymentOrderDialog.getTxfSupplier();
			JTextField txfHandler = paymentOrderDialog.getTxfHandler();
			JTextField txfCreator = paymentOrderDialog.getTxfCreator();
			JTable jTable1 = paymentOrderDialog.getJTable1();
			JTextField txfDate = paymentOrderDialog.getTxfDate();
			JScrollPane jScrollPane1 = paymentOrderDialog.getJScrollPane1();

			Vector colnames3 = new Vector();

			String aa = txfOrderId.getText();
			colnames3.add(aa);

			colnames3.add(txfSupplier.getText());
			colnames3.add(txfCurrency.getText());
			colnames3.add(txfPayAmt.getText());
			colnames3.add(txfPayType.getText());
			colnames3.add(txfBillNum.getText());
			colnames3.add(txfDate.getText());
			colnames3.add(txfHandler.getText());
			colnames3.add(txfCreator.getText());

			colnames4.add(colnames3);
			jTable1 = Mytable.maketable(colnames4, ShowConstants.PAY_HEAD_NAME); // 显示内容
			jScrollPane1.getViewport().add(jTable1); // 把表装入容器
		});
		return ensure;
	}
}
